package Demo1;

class Base {
    public int a = 1;
    public int b = 2;
    public void func1() {
        System.out.println("func1()");
    }
}
class Derived extends Base {
    public int c = 3;
    public int a = 4;
    public void method() {
        a = 10;//这里的a是子类的还是父类的？
        b = 20;
        c = 30;
//        System.out.println(super.a);//父类的a
//        System.out.println(this.a);
//        System.out.println(this.b);
//        System.out.println(this.c);
    }
    public void func2() {
        System.out.println("func2()");
    }
    public void func1() {
        System.out.println("Derived_func1()");
    }
    public void Testfunc() {
        func1();//子类
        super.func1();//父类
        func2();

    }

}
public class Test2 {
    public static void main(String[] args) {
        Derived derived = new Derived();
        derived.method();
        derived.Testfunc();
    }
}
